package com.yanfei.zero.application.handler.lock;

import org.redisson.Redisson;
import org.redisson.api.RedissonClient;
import org.redisson.config.Config;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.Lazy;
/**
 * 分布式锁配置
 * 创建RedissonClient对象
 */
@Configuration
public class RedissonConfig {
  @Bean
  public RedissonClient redissonClient() {
		Config config = new Config();
		config.useSingleServer().
		setAddress("redis://r-bp1v7ytd42owmkeh0ppd.redis.rds.aliyuncs.com:6379")
		.setPassword("smjthy:LMwish16!@!@")
		.setDatabase(10);

		RedissonClient redisson = Redisson.create(config);
		
		return redisson;
  }
}
